package com.learning.code.multithread.keyword.synchronize.method.methodVariables;

public class HasMethodVariablesClass {

    public void changeNumByName(String name){
        try {
            // 定义一个方法内的变量num
            int num = 0;
            if(name.equals("xiaoming")){
                num = 100;
                System.out.println("xiaoming set over");

                    Thread.sleep(2000);

            }else {
                num = 200;
                System.out.println("others set over");
            }
            System.out.println(name + "'num is " + num);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
